const http = require("http");
const path = require("path");

http.createServer((req,res)=>{
    let filePath = path.join(_dirname,"/1.txt");
    /**把文件数据内容一次性的读取到内存中 */
    let fileContent = fs.readFileSync(filePath);
   
    res.end(fileContent);
}).listen(8080)